import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/quanju.css'
import './assets/lib/iconfont.css'


Vue.config.productionTip = false

axios.defaults.baseURL = 'http://127.0.0.1:3000/'
Vue.prototype.$http = axios
Vue.use(ElementUI)

Vue.filter('date', function (value) {
  const dt = new Date(value)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')
  return `${y}-${m}-${d}  ${hh}:${mm}:${ss}`
})
Vue.filter('number', function (value) {
  if (value < 10000) {
    return value;
  } else {
    let n = (value / 10000).toFixed(2) + '万'
    return n
  }
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
